<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: Option Filters</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__opt__filter.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Option Filters</div></div>
</div><!--header-->
<div class="contents">

<p>API functions for access option filters.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterator to run through PDU options.  <a href="structcoap__opt__iterator__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga7bb991b46f70311754e632738d33266b" id="r_ga7bb991b46f70311754e632738d33266b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga7bb991b46f70311754e632738d33266b">COAP_OPT_FILTER_SHORT</a>&#160;&#160;&#160;6</td></tr>
<tr class="memdesc:ga7bb991b46f70311754e632738d33266b"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of option types below 256 that can be stored in an option filter.  <br /></td></tr>
<tr class="separator:ga7bb991b46f70311754e632738d33266b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab098c0305af7c474b5cd79e4204cfb40" id="r_gab098c0305af7c474b5cd79e4204cfb40"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gab098c0305af7c474b5cd79e4204cfb40">COAP_OPT_FILTER_LONG</a>&#160;&#160;&#160;2</td></tr>
<tr class="memdesc:gab098c0305af7c474b5cd79e4204cfb40"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of option types above 255 that can be stored in an option filter.  <br /></td></tr>
<tr class="separator:gab098c0305af7c474b5cd79e4204cfb40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5616439246b1037a0f0b95be017a2c8f" id="r_ga5616439246b1037a0f0b95be017a2c8f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga5616439246b1037a0f0b95be017a2c8f">COAP_OPT_FILTER_SIZE</a>&#160;&#160;&#160;  (((<a class="el" href="group__opt__filter.html#ga7bb991b46f70311754e632738d33266b">COAP_OPT_FILTER_SHORT</a> + 1) &gt;&gt; 1) + <a class="el" href="group__opt__filter.html#gab098c0305af7c474b5cd79e4204cfb40">COAP_OPT_FILTER_LONG</a>) +1</td></tr>
<tr class="memdesc:ga5616439246b1037a0f0b95be017a2c8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of elements in coap_opt_filter_t.  <br /></td></tr>
<tr class="separator:ga5616439246b1037a0f0b95be017a2c8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga81f470e9cdcc258799e10f6ed8a3ce5e" id="r_ga81f470e9cdcc258799e10f6ed8a3ce5e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga81f470e9cdcc258799e10f6ed8a3ce5e">COAP_OPT_ALL</a>&#160;&#160;&#160;NULL</td></tr>
<tr class="memdesc:ga81f470e9cdcc258799e10f6ed8a3ce5e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pre-defined filter that includes all options.  <br /></td></tr>
<tr class="separator:ga81f470e9cdcc258799e10f6ed8a3ce5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga001c5b06ae9e02996509516871cb69a8" id="r_ga001c5b06ae9e02996509516871cb69a8"><td class="memItemLeft" align="right" valign="top">typedef uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>[<a class="el" href="group__opt__filter.html#ga5616439246b1037a0f0b95be017a2c8f">COAP_OPT_FILTER_SIZE</a>]</td></tr>
<tr class="memdesc:ga001c5b06ae9e02996509516871cb69a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fixed-size vector we use for option filtering.  <br /></td></tr>
<tr class="separator:ga001c5b06ae9e02996509516871cb69a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga883885e793388359ef93d195bdbb4c2c" id="r_ga883885e793388359ef93d195bdbb4c2c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga883885e793388359ef93d195bdbb4c2c">coap_option_filter_clear</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> f)</td></tr>
<tr class="memdesc:ga883885e793388359ef93d195bdbb4c2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears filter <code>f</code>.  <br /></td></tr>
<tr class="separator:ga883885e793388359ef93d195bdbb4c2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0170aecd699295f02affd5b280244088" id="r_ga0170aecd699295f02affd5b280244088"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga0170aecd699295f02affd5b280244088">coap_option_filter_set</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type)</td></tr>
<tr class="memdesc:ga0170aecd699295f02affd5b280244088"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the corresponding entry for <code>type</code> in <code>filter</code>.  <br /></td></tr>
<tr class="separator:ga0170aecd699295f02affd5b280244088"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga61706c7da445795c096cb21194b57bb3" id="r_ga61706c7da445795c096cb21194b57bb3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga61706c7da445795c096cb21194b57bb3">coap_option_filter_unset</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type)</td></tr>
<tr class="memdesc:ga61706c7da445795c096cb21194b57bb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the corresponding entry for <code>type</code> in <code>filter</code>.  <br /></td></tr>
<tr class="separator:ga61706c7da445795c096cb21194b57bb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d3a4336ff55e111eae4eb2a1883a98b" id="r_ga3d3a4336ff55e111eae4eb2a1883a98b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga3d3a4336ff55e111eae4eb2a1883a98b">coap_option_filter_get</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type)</td></tr>
<tr class="memdesc:ga3d3a4336ff55e111eae4eb2a1883a98b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if <code>type</code> is contained in <code>filter</code>.  <br /></td></tr>
<tr class="separator:ga3d3a4336ff55e111eae4eb2a1883a98b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6b9ade4855f4440b3311296c03bc12aa" id="r_ga6b9ade4855f4440b3311296c03bc12aa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga6b9ade4855f4440b3311296c03bc12aa">coap_option_setb</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type)</td></tr>
<tr class="memdesc:ga6b9ade4855f4440b3311296c03bc12aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the corresponding bit for <code>type</code> in <code>filter</code>.  <br /></td></tr>
<tr class="separator:ga6b9ade4855f4440b3311296c03bc12aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae505a1c44aa1f5aa01531deaff245e5b" id="r_gae505a1c44aa1f5aa01531deaff245e5b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gae505a1c44aa1f5aa01531deaff245e5b">coap_option_clrb</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type)</td></tr>
<tr class="memdesc:gae505a1c44aa1f5aa01531deaff245e5b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the corresponding bit for <code>type</code> in <code>filter</code>.  <br /></td></tr>
<tr class="separator:gae505a1c44aa1f5aa01531deaff245e5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6c7511c51433cf52068a92a18e62e2d3" id="r_ga6c7511c51433cf52068a92a18e62e2d3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga6c7511c51433cf52068a92a18e62e2d3">coap_option_getb</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type)</td></tr>
<tr class="memdesc:ga6c7511c51433cf52068a92a18e62e2d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the corresponding bit for <code>type</code> in <code>filter</code>.  <br /></td></tr>
<tr class="separator:ga6c7511c51433cf52068a92a18e62e2d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa76930050882387b0f5c7d0246e14440" id="r_gaa76930050882387b0f5c7d0246e14440"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gaa76930050882387b0f5c7d0246e14440">coap_option_iterator_init</a> (const <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, <a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *oi, const <a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter)</td></tr>
<tr class="memdesc:gaa76930050882387b0f5c7d0246e14440"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the given option iterator <code>oi</code> to point to the beginning of the <code>pdu's</code> option list.  <br /></td></tr>
<tr class="separator:gaa76930050882387b0f5c7d0246e14440"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga19d4dbbc03ef362996964fbfdd1d4c7b" id="r_ga19d4dbbc03ef362996964fbfdd1d4c7b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga19d4dbbc03ef362996964fbfdd1d4c7b">coap_option_next</a> (<a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *oi)</td></tr>
<tr class="memdesc:ga19d4dbbc03ef362996964fbfdd1d4c7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the iterator <code>oi</code> to point to the next option.  <br /></td></tr>
<tr class="separator:ga19d4dbbc03ef362996964fbfdd1d4c7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35c348f1ce988e6788930a710f4535c9" id="r_ga35c348f1ce988e6788930a710f4535c9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga35c348f1ce988e6788930a710f4535c9">coap_check_option</a> (<a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, uint16_t type, <a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *oi)</td></tr>
<tr class="memdesc:ga35c348f1ce988e6788930a710f4535c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the first option of type <code>type</code> from <code>pdu</code>.  <br /></td></tr>
<tr class="separator:ga35c348f1ce988e6788930a710f4535c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafebbd04a7895df694a9345dad0275aeb" id="r_gafebbd04a7895df694a9345dad0275aeb"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gafebbd04a7895df694a9345dad0275aeb">coap_opt_setheader</a> (<a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt, size_t maxlen, uint16_t delta, size_t length)</td></tr>
<tr class="memdesc:gafebbd04a7895df694a9345dad0275aeb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encodes the given delta and length values into <code>opt</code>.  <br /></td></tr>
<tr class="separator:gafebbd04a7895df694a9345dad0275aeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga55f19454026048e906139d575feddecb" id="r_ga55f19454026048e906139d575feddecb"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga55f19454026048e906139d575feddecb">coap_opt_encode_size</a> (uint16_t delta, size_t length)</td></tr>
<tr class="memdesc:ga55f19454026048e906139d575feddecb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute storage bytes needed for an option with given <code>delta</code> and <code>length</code>.  <br /></td></tr>
<tr class="separator:ga55f19454026048e906139d575feddecb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga358cb455deaefca1b1234298f018c9ab" id="r_ga358cb455deaefca1b1234298f018c9ab"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga358cb455deaefca1b1234298f018c9ab">coap_opt_encode</a> (<a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt, size_t n, uint16_t delta, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *val, size_t length)</td></tr>
<tr class="memdesc:ga358cb455deaefca1b1234298f018c9ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encodes option with given <code>delta</code> into <code>opt</code>.  <br /></td></tr>
<tr class="separator:ga358cb455deaefca1b1234298f018c9ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae6aced1ef1014a692f68b3a13c7d6b70" id="r_gae6aced1ef1014a692f68b3a13c7d6b70"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gae6aced1ef1014a692f68b3a13c7d6b70">coap_opt_delta</a> (const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt)</td></tr>
<tr class="memdesc:gae6aced1ef1014a692f68b3a13c7d6b70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decodes the delta value of the next option.  <br /></td></tr>
<tr class="separator:gae6aced1ef1014a692f68b3a13c7d6b70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac65919c93f7047b687d33af9672b3ea" id="r_gaac65919c93f7047b687d33af9672b3ea"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gaac65919c93f7047b687d33af9672b3ea">coap_opt_length</a> (const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt)</td></tr>
<tr class="memdesc:gaac65919c93f7047b687d33af9672b3ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the length of the given option.  <br /></td></tr>
<tr class="separator:gaac65919c93f7047b687d33af9672b3ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaec4e944d39722779cac610ed22ee09db" id="r_gaec4e944d39722779cac610ed22ee09db"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gaec4e944d39722779cac610ed22ee09db">coap_opt_value</a> (const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt)</td></tr>
<tr class="memdesc:gaec4e944d39722779cac610ed22ee09db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the value of the given option.  <br /></td></tr>
<tr class="separator:gaec4e944d39722779cac610ed22ee09db"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>API functions for access option filters. </p>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga81f470e9cdcc258799e10f6ed8a3ce5e" name="ga81f470e9cdcc258799e10f6ed8a3ce5e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga81f470e9cdcc258799e10f6ed8a3ce5e">&#9670;&#160;</a></span>COAP_OPT_ALL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_OPT_ALL&#160;&#160;&#160;NULL</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pre-defined filter that includes all options. </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00122">122</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="gab098c0305af7c474b5cd79e4204cfb40" name="gab098c0305af7c474b5cd79e4204cfb40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab098c0305af7c474b5cd79e4204cfb40">&#9670;&#160;</a></span>COAP_OPT_FILTER_LONG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_OPT_FILTER_LONG&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of option types above 255 that can be stored in an option filter. </p>
<p>COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be at most 16. Each coap_option_filter_t object reserves COAP_OPT_FILTER_LONG * 2 bytes for short options. </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00084">84</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="ga7bb991b46f70311754e632738d33266b" name="ga7bb991b46f70311754e632738d33266b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7bb991b46f70311754e632738d33266b">&#9670;&#160;</a></span>COAP_OPT_FILTER_SHORT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_OPT_FILTER_SHORT&#160;&#160;&#160;6</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of option types below 256 that can be stored in an option filter. </p>
<p>COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be at most 16. Each coap_option_filter_t object reserves ((COAP_OPT_FILTER_SHORT + 1) / 2) * 2 bytes for short options. </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00076">76</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="ga5616439246b1037a0f0b95be017a2c8f" name="ga5616439246b1037a0f0b95be017a2c8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5616439246b1037a0f0b95be017a2c8f">&#9670;&#160;</a></span>COAP_OPT_FILTER_SIZE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_OPT_FILTER_SIZE&#160;&#160;&#160;  (((<a class="el" href="group__opt__filter.html#ga7bb991b46f70311754e632738d33266b">COAP_OPT_FILTER_SHORT</a> + 1) &gt;&gt; 1) + <a class="el" href="group__opt__filter.html#gab098c0305af7c474b5cd79e4204cfb40">COAP_OPT_FILTER_LONG</a>) +1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of elements in coap_opt_filter_t. </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00093">93</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga001c5b06ae9e02996509516871cb69a8" name="ga001c5b06ae9e02996509516871cb69a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga001c5b06ae9e02996509516871cb69a8">&#9670;&#160;</a></span>coap_opt_filter_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef uint16_t coap_opt_filter_t[<a class="el" href="group__opt__filter.html#ga5616439246b1037a0f0b95be017a2c8f">COAP_OPT_FILTER_SIZE</a>]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Fixed-size vector we use for option filtering. </p>
<p>It is large enough to hold COAP_OPT_FILTER_SHORT entries with an option number between 0 and 255, and COAP_OPT_FILTER_LONG entries with an option number between 256 and 65535. Its internal structure is</p>
<div class="fragment"><div class="line"><span class="keyword">struct </span>{</div>
<div class="line">  uint16_t mask;</div>
<div class="line">  uint16_t long_opts[<a class="code hl_define" href="group__opt__filter.html#gab098c0305af7c474b5cd79e4204cfb40">COAP_OPT_FILTER_LONG</a>];</div>
<div class="line">  <a class="code hl_typedef" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> short_opts[<a class="code hl_define" href="group__opt__filter.html#ga7bb991b46f70311754e632738d33266b">COAP_OPT_FILTER_SHORT</a>];</div>
<div class="line">}</div>
<div class="ttc" id="agroup__opt__filter_html_ga7bb991b46f70311754e632738d33266b"><div class="ttname"><a href="group__opt__filter.html#ga7bb991b46f70311754e632738d33266b">COAP_OPT_FILTER_SHORT</a></div><div class="ttdeci">#define COAP_OPT_FILTER_SHORT</div><div class="ttdoc">The number of option types below 256 that can be stored in an option filter.</div><div class="ttdef"><b>Definition</b> <a href="option_8h_source.html#l00076">option.h:76</a></div></div>
<div class="ttc" id="agroup__opt__filter_html_gab098c0305af7c474b5cd79e4204cfb40"><div class="ttname"><a href="group__opt__filter.html#gab098c0305af7c474b5cd79e4204cfb40">COAP_OPT_FILTER_LONG</a></div><div class="ttdeci">#define COAP_OPT_FILTER_LONG</div><div class="ttdoc">The number of option types above 255 that can be stored in an option filter.</div><div class="ttdef"><b>Definition</b> <a href="option_8h_source.html#l00084">option.h:84</a></div></div>
<div class="ttc" id="authash_8h_html_aba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition</b> <a href="uthash_8h_source.html#l00079">uthash.h:79</a></div></div>
</div><!-- fragment --><p>The first element contains a bit vector that indicates which fields in the remaining array are used. The first COAP_OPT_FILTER_LONG bits correspond to the long option types that are stored in the elements from index 1 to COAP_OPT_FILTER_LONG. The next COAP_OPT_FILTER_SHORT bits correspond to the short option types that are stored in the elements from index COAP_OPT_FILTER_LONG + 1 to COAP_OPT_FILTER_LONG + COAP_OPT_FILTER_SHORT. The latter elements are treated as bytes. </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00119">119</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga35c348f1ce988e6788930a710f4535c9" name="ga35c348f1ce988e6788930a710f4535c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga35c348f1ce988e6788930a710f4535c9">&#9670;&#160;</a></span>coap_check_option()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> * coap_check_option </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *&#160;</td>
          <td class="paramname"><em>oi</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the first option of type <code>type</code> from <code>pdu</code>. </p>
<p><code>oi</code> must point to a <a class="el" href="structcoap__opt__iterator__t.html" title="Iterator to run through PDU options.">coap_opt_iterator_t</a> object that will be initialized by this function to filter only options with code <code>type</code>. This function returns the first option with this type, or <code>NULL</code> if not found.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pdu</td><td>The PDU to parse for options. </td></tr>
    <tr><td class="paramname">type</td><td>The option type code to search for. </td></tr>
    <tr><td class="paramname">oi</td><td>An iterator object to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the first option of type <code>type</code>, or <code>NULL</code> if not found. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00207">207</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="gae6aced1ef1014a692f68b3a13c7d6b70" name="gae6aced1ef1014a692f68b3a13c7d6b70"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae6aced1ef1014a692f68b3a13c7d6b70">&#9670;&#160;</a></span>coap_opt_delta()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t coap_opt_delta </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>opt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decodes the delta value of the next option. </p>
<p>This function returns the number of bytes read or <code>0</code> on error. The caller of this function must ensure that it does not read over the boundaries of <code>opt</code> (e.g. by calling coap_opt_check_delta().</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opt</td><td>The option to examine.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes read or <code>0</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00220">220</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="ga358cb455deaefca1b1234298f018c9ab" name="ga358cb455deaefca1b1234298f018c9ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga358cb455deaefca1b1234298f018c9ab">&#9670;&#160;</a></span>coap_opt_encode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t coap_opt_encode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>opt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>delta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Encodes option with given <code>delta</code> into <code>opt</code>. </p>
<p>This function returns the number of bytes written to <code>opt</code> or <code>0</code> on error. This happens especially when <code>opt</code> does not provide sufficient space to store the option value, delta, and option jumps when required.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opt</td><td>The option buffer space where <code>val</code> is written. </td></tr>
    <tr><td class="paramname">n</td><td>Maximum length of <code>opt</code>. </td></tr>
    <tr><td class="paramname">delta</td><td>The option delta. </td></tr>
    <tr><td class="paramname">val</td><td>The option value to copy into <code>opt</code>. </td></tr>
    <tr><td class="paramname">length</td><td>The actual length of <code>val</code>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes that have been written to <code>opt</code> or <code>0</code> on error. The return value will always be less than <code>n</code>. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00409">409</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="ga55f19454026048e906139d575feddecb" name="ga55f19454026048e906139d575feddecb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga55f19454026048e906139d575feddecb">&#9670;&#160;</a></span>coap_opt_encode_size()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t coap_opt_encode_size </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>delta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compute storage bytes needed for an option with given <code>delta</code> and <code>length</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">delta</td><td>The option delta. </td></tr>
    <tr><td class="paramname">length</td><td>The option length.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes required to encode this option. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00388">388</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="gaac65919c93f7047b687d33af9672b3ea" name="gaac65919c93f7047b687d33af9672b3ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaac65919c93f7047b687d33af9672b3ea">&#9670;&#160;</a></span>coap_opt_length()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t coap_opt_length </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>opt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the length of the given option. </p>
<p><code>opt</code> must point to an option jump or the beginning of the option. This function returns <code>0</code> when <code>opt</code> is not an option or the actual length of <code>opt</code> (which can be <code>0</code> as well).</p>
<dl class="section note"><dt>Note</dt><dd>{The rationale for using <code>0</code> in case of an error is that in most contexts, the result of this function is used to skip the next <a class="el" href="group__opt__filter.html#gaac65919c93f7047b687d33af9672b3ea" title="Returns the length of the given option.">coap_opt_length()</a> bytes.}</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opt</td><td>The option whose length should be returned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The option's length or <code>0</code> when undefined. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00249">249</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="gafebbd04a7895df694a9345dad0275aeb" name="gafebbd04a7895df694a9345dad0275aeb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafebbd04a7895df694a9345dad0275aeb">&#9670;&#160;</a></span>coap_opt_setheader()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t coap_opt_setheader </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>opt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>maxlen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>delta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Encodes the given delta and length values into <code>opt</code>. </p>
<p>This function returns the number of bytes that were required to encode <code>delta</code> and <code>length</code> or <code>0</code> on error. Note that the result indicates by how many bytes <code>opt</code> must be advanced to encode the option value.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opt</td><td>The option buffer space where <code>delta</code> and <code>length</code> are written. </td></tr>
    <tr><td class="paramname">maxlen</td><td>The maximum length of <code>opt</code>. </td></tr>
    <tr><td class="paramname">delta</td><td>The actual delta value to encode. </td></tr>
    <tr><td class="paramname">length</td><td>The actual length value to encode.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes used or <code>0</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00329">329</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="gaec4e944d39722779cac610ed22ee09db" name="gaec4e944d39722779cac610ed22ee09db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaec4e944d39722779cac610ed22ee09db">&#9670;&#160;</a></span>coap_opt_value()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> * coap_opt_value </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>opt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a pointer to the value of the given option. </p>
<p><code>opt</code> must point to an option jump or the beginning of the option. This function returns <code>NULL</code> if <code>opt</code> is not a valid option.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opt</td><td>The option whose value should be returned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the option value or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00286">286</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="gae505a1c44aa1f5aa01531deaff245e5b" name="gae505a1c44aa1f5aa01531deaff245e5b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae505a1c44aa1f5aa01531deaff245e5b">&#9670;&#160;</a></span>coap_option_clrb()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int coap_option_clrb </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>filter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears the corresponding bit for <code>type</code> in <code>filter</code>. </p>
<p>This function returns <code>1</code> if bit was cleared or <code>-1</code> on error (i.e. when the given type does not fit in the filter).</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000005">Deprecated:</a></b></dt><dd>Use <a class="el" href="group__opt__filter.html#ga61706c7da445795c096cb21194b57bb3" title="Clears the corresponding entry for type in filter.">coap_option_filter_unset()</a> instead.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filter</td><td>The filter object to change. </td></tr>
    <tr><td class="paramname">type</td><td>The type for which the bit should be cleared.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if bit was set, <code>-1</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00200">200</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="ga883885e793388359ef93d195bdbb4c2c" name="ga883885e793388359ef93d195bdbb4c2c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga883885e793388359ef93d195bdbb4c2c">&#9670;&#160;</a></span>coap_option_filter_clear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void coap_option_filter_clear </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>f</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears filter <code>f</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>The filter to clear. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00130">130</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="ga3d3a4336ff55e111eae4eb2a1883a98b" name="ga3d3a4336ff55e111eae4eb2a1883a98b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d3a4336ff55e111eae4eb2a1883a98b">&#9670;&#160;</a></span>coap_option_filter_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_option_filter_get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>filter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if <code>type</code> is contained in <code>filter</code>. </p>
<p>This function returns <code>1</code> if found, <code>0</code> if not, or <code>-1</code> on error (i.e. when the given type does not fit in the filter).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filter</td><td>The filter object to search. </td></tr>
    <tr><td class="paramname">type</td><td>The type to search for.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if <code>type</code> was found, <code>0</code> otherwise, or <code>-1</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00544">544</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="ga0170aecd699295f02affd5b280244088" name="ga0170aecd699295f02affd5b280244088"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0170aecd699295f02affd5b280244088">&#9670;&#160;</a></span>coap_option_filter_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_option_filter_set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>filter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the corresponding entry for <code>type</code> in <code>filter</code>. </p>
<p>This function returns <code>1</code> if bit was set or <code>0</code> on error (i.e. when the given type does not fit in the filter).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filter</td><td>The filter object to change. </td></tr>
    <tr><td class="paramname">type</td><td>The type for which the bit should be set.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if bit was set, <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00534">534</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="ga61706c7da445795c096cb21194b57bb3" name="ga61706c7da445795c096cb21194b57bb3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga61706c7da445795c096cb21194b57bb3">&#9670;&#160;</a></span>coap_option_filter_unset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_option_filter_unset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>filter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears the corresponding entry for <code>type</code> in <code>filter</code>. </p>
<p>This function returns <code>1</code> if bit was set or <code>0</code> on error (i.e. when the given type does not fit in the filter).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filter</td><td>The filter object to change. </td></tr>
    <tr><td class="paramname">type</td><td>The type that should be cleared from the filter.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if bit was set, <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00539">539</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="ga6c7511c51433cf52068a92a18e62e2d3" name="ga6c7511c51433cf52068a92a18e62e2d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6c7511c51433cf52068a92a18e62e2d3">&#9670;&#160;</a></span>coap_option_getb()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int coap_option_getb </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>filter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the corresponding bit for <code>type</code> in <code>filter</code>. </p>
<p>This function returns <code>1</code> if the bit is set <code>0</code> if not, or <code>-1</code> on error (i.e. when the given type does not fit in the filter).</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000006">Deprecated:</a></b></dt><dd>Use <a class="el" href="group__opt__filter.html#ga3d3a4336ff55e111eae4eb2a1883a98b" title="Checks if type is contained in filter.">coap_option_filter_get()</a> instead.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filter</td><td>The filter object to read bit from. </td></tr>
    <tr><td class="paramname">type</td><td>The type for which the bit should be read.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if bit was set, <code>0</code> if not, <code>-1</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00217">217</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="gaa76930050882387b0f5c7d0246e14440" name="gaa76930050882387b0f5c7d0246e14440"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa76930050882387b0f5c7d0246e14440">&#9670;&#160;</a></span>coap_option_iterator_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> * coap_option_iterator_init </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *&#160;</td>
          <td class="paramname"><em>oi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>filter</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the given option iterator <code>oi</code> to point to the beginning of the <code>pdu's</code> option list. </p>
<p>This function returns <code>oi</code> on success, <code>NULL</code> otherwise (i.e. when no options exist). Note that a length check on the option list must be performed before <a class="el" href="group__opt__filter.html#gaa76930050882387b0f5c7d0246e14440" title="Initializes the given option iterator oi to point to the beginning of the pdu&#39;s option list.">coap_option_iterator_init()</a> is called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pdu</td><td>The PDU the options of which should be walked through. </td></tr>
    <tr><td class="paramname">oi</td><td>An iterator object that will be initilized. </td></tr>
    <tr><td class="paramname">filter</td><td>An optional option type filter. With <code>type</code> != <code>COAP_OPT_ALL</code>, <a class="el" href="group__opt__filter.html#ga19d4dbbc03ef362996964fbfdd1d4c7b" title="Updates the iterator oi to point to the next option.">coap_option_next()</a> will return only options matching this bitmask. Fence-post options <code>14</code>, <code>28</code>, <code>42</code>, ... are always skipped.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The iterator object <code>oi</code> on success, <code>NULL</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00121">121</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="ga19d4dbbc03ef362996964fbfdd1d4c7b" name="ga19d4dbbc03ef362996964fbfdd1d4c7b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga19d4dbbc03ef362996964fbfdd1d4c7b">&#9670;&#160;</a></span>coap_option_next()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> * coap_option_next </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *&#160;</td>
          <td class="paramname"><em>oi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Updates the iterator <code>oi</code> to point to the next option. </p>
<p>This function returns a pointer to that option or <code>NULL</code> if no more options exist. The contents of <code>oi</code> will be updated. In particular, <code>oi-&gt;n</code> specifies the current option's ordinal number (counted from <code>1</code>), <code>oi-&gt;type</code> is the option's type code, and <code>oi-&gt;option</code> points to the beginning of the current option itself. When advanced past the last option, <code>oi-&gt;option</code> will be <code>NULL</code>.</p>
<p>Note that options are skipped whose corresponding bits in the filter specified with <a class="el" href="group__opt__filter.html#gaa76930050882387b0f5c7d0246e14440" title="Initializes the given option iterator oi to point to the beginning of the pdu&#39;s option list.">coap_option_iterator_init()</a> are <code>0</code>. Options with type codes that do not fit in this filter hence will always be returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">oi</td><td>The option iterator to update.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The next option or <code>NULL</code> if no more options exist. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00157">157</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="ga6b9ade4855f4440b3311296c03bc12aa" name="ga6b9ade4855f4440b3311296c03bc12aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6b9ade4855f4440b3311296c03bc12aa">&#9670;&#160;</a></span>coap_option_setb()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int coap_option_setb </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>filter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the corresponding bit for <code>type</code> in <code>filter</code>. </p>
<p>This function returns <code>1</code> if bit was set or <code>-1</code> on error (i.e. when the given type does not fit in the filter).</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000004">Deprecated:</a></b></dt><dd>Use <a class="el" href="group__opt__filter.html#ga0170aecd699295f02affd5b280244088" title="Sets the corresponding entry for type in filter.">coap_option_filter_set()</a> instead.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filter</td><td>The filter object to change. </td></tr>
    <tr><td class="paramname">type</td><td>The type for which the bit should be set.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if bit was set, <code>-1</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00183">183</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
